package com.seawaterbt.ssm.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.seawaterbt.ssm.config.DataSource;
import com.seawaterbt.ssm.config.DataSourceEnum;
import com.seawaterbt.ssm.entity.CzBasBoiler;
import com.seawaterbt.ssm.entity.CzBasCrew;
import com.seawaterbt.ssm.mapper.CzBasBoilerMapper;
import com.seawaterbt.ssm.service.CzBasBoilerService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhf
 * @since 2019-10-31
 */
@Service
public class CzBasBoilerServiceImpl extends ServiceImpl<CzBasBoilerMapper, CzBasBoiler> implements CzBasBoilerService {

    @DataSource(DataSourceEnum.DB2)
    @Override
    public List<CzBasBoiler> listMatchCrew() {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.isNotNull("original_code");
        return this.list(queryWrapper);
    }
    @DataSource(DataSourceEnum.DB2)
    @Override
    public CzBasBoiler listOne(String code) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("code",code);
        return this.getOne(wrapper);
    }
    @DataSource(DataSourceEnum.DB2)
    @Override
    public CzBasBoiler GetOneByProviencecode(String provinceCode) {
        QueryWrapper wrapper = new QueryWrapper();
        wrapper.eq("code_province",provinceCode);
        return this.getOne(wrapper);
    }

    @DataSource(DataSourceEnum.DB2)
    @Override
    public List<CzBasBoiler> list(Wrapper<CzBasBoiler> queryWrapper) {
        return super.list(queryWrapper);
    }
}
